package com.heima.comment.utils;

import com.heima.model.user.pojos.ApUser;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2023/3/16 10:12
 * @Version 1.0
 */
public class CommentThreadLocalUtil{
    
    private final static ThreadLocal<ApUser> LOCAL = new ThreadLocal<>();

    public static void setUser(ApUser user){
        LOCAL.set(user);
    }
    
    public static ApUser getUser(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}